﻿<%@ Page Language="C#" MasterPageFile="~/U_masterP.master" AutoEventWireup="true"
    CodeFile="contact.aspx.cs" Inherits="contact" %>

<%@ Register Src="uc_main/sideBar_right.ascx" TagName="sideBar_right" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>Liên hệ</title>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="content_top">
        <%--<asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">--%>
        <div id="kep">
            <a>LIÊN HỆ</a></div>
        <div id="tags">
            <p class="title_p" style="color: #528602">
                Liên hệ với chúng tôi khi bạn cần giúp đỡ.</p>
        </div>
        <%--</asp:ContentPlaceHolder>--%>
    </div>
    <div class="clear">
    </div>
    <div id="sub_content">
        <div id="content_left">
            <%--<asp:ContentPlaceHolder ID="main_content" runat="server">                    --%>
            <table style="width: 100%; margin-top: 10px;" cellpadding="5" cellspacing="0" id="tbl_lienhe">
                <tr>
                    <td width="100" align="right" class="tiude">
                        Họ tên:
                    </td>
                    <td>
                        <asp:TextBox ID="txt_hoten" runat="server" MaxLength="50" CssClass="text1" Width="175px"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="TextBox1_FilteredTextBoxExtender" runat="server"
                            FilterMode="InvalidChars" InvalidChars="!@#$%^&amp;*()_-+=\|{}[]&quot;':,&lt;&gt;.?/"
                            TargetControlID="txt_hoten">
                        </ajaxToolkit:FilteredTextBoxExtender>
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right" class="tiude">
                        Email:
                    </td>
                    <td>
                        <asp:TextBox ID="txt_email" runat="server" MaxLength="50" CssClass="text2" Width="175px"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server"
                            FilterMode="InvalidChars" InvalidChars="!#$%^&amp;*()_-+=\|{}[]&quot;':,&lt;&gt;?/"
                            TargetControlID="txt_email">
                        </ajaxToolkit:FilteredTextBoxExtender>
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right" class="tiude">
                        Địa chỉ:
                    </td>
                    <td>
                        <asp:TextBox ID="txt_diachi" runat="server" CssClass="text3" Width="175px"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server"
                            FilterMode="InvalidChars" InvalidChars="!@#$%^&amp;*()_-+=\|{}[]&quot;':,&lt;&gt;;.?/"
                            TargetControlID="txt_diachi">
                        </ajaxToolkit:FilteredTextBoxExtender>
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right" class="tiude">
                        Điện thoại:
                    </td>
                    <td>
                        <asp:TextBox ID="txt_dienthoai" runat="server" MaxLength="15" CssClass="text4" Width="175px"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server"
                            FilterMode="InvalidChars" InvalidChars="!@#$%^&amp;*()_-+=\|{}[]&quot;':,&lt;&gt;.?/"
                            TargetControlID="txt_dienthoai">
                        </ajaxToolkit:FilteredTextBoxExtender>
                        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender4" runat="server"
                            TargetControlID="txt_dienthoai" FilterType="Numbers">
                        </ajaxToolkit:FilteredTextBoxExtender>
                        <ajaxToolkit:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server"
                            TargetControlID="txt_dienthoai" WatermarkText="Số điện thoại" WatermarkCssClass="watermarked" />
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right" class="tiude">
                        Tiêu đề:
                    </td>
                    <td>
                        <asp:TextBox ID="txt_tieude" runat="server" MaxLength="250" CssClass="text5" Width="175px"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender5" runat="server"
                            FilterMode="InvalidChars" InvalidChars="!@#$%^&amp;*()_-+=\|{}[]&quot;':,&lt;&gt;.?/"
                            TargetControlID="txt_tieude">
                        </ajaxToolkit:FilteredTextBoxExtender>
                    </td>
                </tr>
                <tr>
                    <td width="100" align="right" class="tiude">
                        Nội dung:
                    </td>
                    <td>
                        <asp:TextBox ID="txt_noidung" runat="server" MaxLength="100" TextMode="MultiLine"
                            CssClass="text7" Height="134px" Width="452px"></asp:TextBox>
                        <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender6" runat="server"
                            FilterMode="InvalidChars" InvalidChars="@#$%^&amp;*()_-+=\|{}[]&quot;':&lt;&gt;?/"
                            TargetControlID="txt_noidung">
                        </ajaxToolkit:FilteredTextBoxExtender>
                    </td>
                </tr>
                <tr>
                    <td width="100">
                        &nbsp;
                    </td>
                    <td>
                        <asp:Button ID="butt_send" runat="server" Text="Gửi" CssClass="button_V" OnClientClick="return OnSubmitContact()"
                            OnClick="butt_send_Click" />
                        &nbsp;
                        <input id="btn_reset" type="button" value="Làm lại" class="button_V" onclick="XoaMau()" />
                    </td>
                </tr>
                <%--<tr>
                <td width="100">
                    &nbsp;</td>
                <td>
                    <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                    <p style="font-size:11px; font-style:italic; color:#0946b6">
                    */ Bạn không muốn gặp rắc rối với những văn bản pháp luật ?<br />
                    */ Bạn muốn việc làm giấy tờ thật nhan chóng ?<br />
                    */ Bạn đang có khúc mắc về pháp lý ?<br />
                    Hãy liên hệ với Vietcare.us ! Chúng tôi sẽ hỗ trợ bạn !
                    </p>
                </td>
            </tr>--%>
            </table>
            <asp:Literal ID="Literal1" runat="server"></asp:Literal>
            <%--</asp:ContentPlaceHolder>--%>
        </div>
        <div id="content_right">
            <%--<asp:ContentPlaceHolder ID="contentBenPhai" runat="server">--%>
            <uc1:sideBar_right ID="sideBar_right1" runat="server" />
            <%--</asp:ContentPlaceHolder>   --%>
        </div>
    </div>
    <script type="text/javascript">
        var text1 = "Họ tên";
        var text2 = "Email";
        var text3 = "Địa chỉ";
        var text4 = "Số điện thoại";
        var text5 = "Tiêu đề";
        var text7 = "Nội dung";
        $(function () {
            //1-----------------------------------
            $(".text1").focus(function () {
                txt_truoc = $(this).val();
                if ($(this).val() == text1)
                    $(this).val("");
                //$(this).css("border","1px #8bc33d solid");
            });

            $(".text1").blur(function () {
                if ($(this).val() == "")
                    $(this).val(text1);
                //$(this).css("border","1px #d9dada solid");
            });

            //2-----------------------------------
            $(".text2").focus(function () {
                txt_truoc = $(this).val();
                if ($(this).val() == text2)
                    $(this).val("");
                //$(this).css("border","1px #8bc33d solid");
            });

            $(".text2").blur(function () {
                if ($(this).val() == "")
                    $(this).val(text2);
                //$(this).css("border","1px #d9dada solid");
            });

            //3-----------------------------------
            $(".text3").focus(function () {
                txt_truoc = $(this).val();
                if ($(this).val() == text3)
                    $(this).val("");
                // $(this).css("border","1px #8bc33d solid");
            });

            $(".text3").blur(function () {
                if ($(this).val() == "")
                    $(this).val(text3);
                //$(this).css("border","1px #d9dada solid");
            });

            //4-----------------------------------
            $(".text4").focus(function () {
                txt_truoc = $(this).val();
                if ($(this).val() == text4)
                    $(this).val("");
                //$(this).css("border","1px #8bc33d solid");
            });

            $(".text4").blur(function () {
                if ($(this).val() == "")
                    $(this).val(text4);
                //$(this).css("border","1px #d9dada solid");
            });

            //5-----------------------------------
            $(".text5").focus(function () {
                txt_truoc = $(this).val();
                if ($(this).val() == text5)
                    $(this).val("");
                //$(this).css("border","1px #8bc33d solid");
            });

            $(".text5").blur(function () {
                if ($(this).val() == "")
                    $(this).val(text5);
                //$(this).css("border","1px #d9dada solid");
            });

            //7-----------------------------------
            $(".text7").focus(function () {
                txt_truoc = $(this).val();
                if ($(this).val() == text7)
                    $(this).val("");
                //$(this).css("border","1px #8bc33d solid");
            });

            $(".text7").blur(function () {
                if ($(this).val() == "")
                    $(this).val(text7);
                //$(this).css("border","1px #d9dada solid");
            });

            XoaMau();

            $(".text9").click(function () {
                XoaMau();
            });
        });

        function XoaMau() {
            $(".text1").val(text1);
            $(".text2").val(text2);
            $(".text3").val(text3);
            $(".text4").val(text4);
            $(".text5").val(text5);
            $(".text7").val(text7);
        }

        function OnSubmitContact() {
            if ($(".text1").val() == "" || $(".text1").val() == text1) {
                alert("Mời bạn nhập họ tên!");
                $(".text1").focus();
                return false;
            }
            else if ($(".text2").val() == "" || $(".text2").val() == text2) {
                alert("Mời bạn nhập email!");
                $(".text2").focus();
                return false;
            }
            else if ($(".text3").val() == "" || $(".text3").val() == text3) {
                alert("Mời bạn nhập địa chỉ!");
                $(".text3").focus();
                return false;
            }
            else if ($(".text4").val() == "" || $(".text4").val() == text4) {
                alert("Mời bạn nhập số điện thoại!");
                $(".text4").focus();
                return false;
            }
            else if ($(".text5").val() == "" || $(".text5").val() == text5) {
                alert("Mời bạn nhập tiêu đề!");
                $(".text5").focus();
                return false;
            }
            else {
                var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

                var emailaddressVal = $(".text2").val();
                if (!emailReg.test(emailaddressVal)) {
                    alert("Email không hợp lệ! Mời bạn nhập lại email!");
                    $(".text2").focus();
                    return false;
                }
            }

            return true;

        }

    </script>
</asp:Content>
